package com.yehongyu.mytools.basic.grammar;

import java.util.Enumeration;
import java.util.Vector;

interface Shape {
	void draw();
}

class Circle implements Shape {
	public void draw() {
		System.out.println("Circle.draw()");
	}
}

class Square implements Shape {
	public void draw() {
		System.out.println("Square.draw()");
	}
}

class Triangle implements Shape {
	public void draw() {
		System.out.println("Triangle.draw()");
	}
}

public class Java008_Implement {
	public static void main(String[] args) {
		Vector<Shape> s = new Vector<Shape>();
		s.addElement(new Square());
		s.addElement(new Circle());
		s.addElement(new Triangle());
		Enumeration<Shape> e = s.elements();
		while (e.hasMoreElements())
			e.nextElement().draw();

	}
} // /:~

